package com.framework.loippi.job;

import com.framework.loippi.service.RedisService;
import com.framework.loippi.service.SystemMessageService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时任务
 *
 * @author Administrator
 */
@Component("JobDemo")
@Lazy(false)
public class JobDemo {

//<cron-expression>0 0/30 * * * ?</cron-expression>:每隔30分钟 
//<cron-expression>0 0/15 * * * ?</cron-expression>每隔15分钟 
//<cron-expression>0 0 0/1 * * ?</cron-expression>每隔1个小时

    @Value("${job.enabled}")
    private Boolean jobEnabled;

    @Resource
    private RedisService redisService;
    @Resource
    private SystemMessageService systemMessageService;


    @Scheduled(cron = "0 0/1 * * * ?")
    public void build() {
        if (!Boolean.TRUE.equals(jobEnabled)) {
            return;
        }

    }
}

